3.191 \(\int \tan ^6(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=80 \[ \frac{(a-b) \tan ^5(e+f x)}{5 f}-\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{(a-b) \tan (e+f x)}{f}-x (a-b)+\frac{b \tan ^7(e+f x)}{7 f} \]

[Out]

-((a - b)*x) + ((a - b)*Tan[e + f*x])/f - ((a - b)*Tan[e + f*x]^3)/(3*f) + ((a - b)*Tan[e + f*x]^5)/(5*f) + (b
*Tan[e + f*x]^7)/(7*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0523921, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3631, 3473, 8} \[ \frac{(a-b) \tan ^5(e+f x)}{5 f}-\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{(a-b) \tan (e+f x)}{f}-x (a-b)+\frac{b \tan ^7(e+f x)}{7 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^6*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a - b)*x) + ((a - b)*Tan[e + f*x])/f - ((a - b)*Tan[e + f*x]^3)/(3*f) + ((a - b)*Tan[e + f*x]^5)/(5*f) + (b
*Tan[e + f*x]^7)/(7*f)

Rule 3631

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp
[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[A - C, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[
{a, b, e, f, A, C, m}, x] && NeQ[A*b^2 + a^2*C, 0] &&  !LeQ[m, -1]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \tan ^6(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{b \tan ^7(e+f x)}{7 f}+(a-b) \int \tan ^6(e+f x) \, dx\\ &=\frac{(a-b) \tan ^5(e+f x)}{5 f}+\frac{b \tan ^7(e+f x)}{7 f}+(-a+b) \int \tan ^4(e+f x) \, dx\\ &=-\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{(a-b) \tan ^5(e+f x)}{5 f}+\frac{b \tan ^7(e+f x)}{7 f}+(a-b) \int \tan ^2(e+f x) \, dx\\ &=\frac{(a-b) \tan (e+f x)}{f}-\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{(a-b) \tan ^5(e+f x)}{5 f}+\frac{b \tan ^7(e+f x)}{7 f}+(-a+b) \int 1 \, dx\\ &=-(a-b) x+\frac{(a-b) \tan (e+f x)}{f}-\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{(a-b) \tan ^5(e+f x)}{5 f}+\frac{b \tan ^7(e+f x)}{7 f}\\ \end{align*}

Mathematica [A]  time = 0.0473769, size = 129, normalized size = 1.61 \[ \frac{a \tan ^5(e+f x)}{5 f}-\frac{a \tan ^3(e+f x)}{3 f}-\frac{a \tan ^{-1}(\tan (e+f x))}{f}+\frac{a \tan (e+f x)}{f}+\frac{b \tan ^7(e+f x)}{7 f}-\frac{b \tan ^5(e+f x)}{5 f}+\frac{b \tan ^3(e+f x)}{3 f}+\frac{b \tan ^{-1}(\tan (e+f x))}{f}-\frac{b \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^6*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*ArcTan[Tan[e + f*x]])/f) + (b*ArcTan[Tan[e + f*x]])/f + (a*Tan[e + f*x])/f - (b*Tan[e + f*x])/f - (a*Tan[
e + f*x]^3)/(3*f) + (b*Tan[e + f*x]^3)/(3*f) + (a*Tan[e + f*x]^5)/(5*f) - (b*Tan[e + f*x]^5)/(5*f) + (b*Tan[e
+ f*x]^7)/(7*f)

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 120, normalized size = 1.5 \begin{align*}{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{7}}{7\,f}}+{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{5}a}{5\,f}}-{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{5}}{5\,f}}-{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{3}a}{3\,f}}+{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{3\,f}}+{\frac{a\tan \left ( fx+e \right ) }{f}}-{\frac{b\tan \left ( fx+e \right ) }{f}}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) a}{f}}+{\frac{b\arctan \left ( \tan \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^6*(a+b*tan(f*x+e)^2),x)

[Out]

1/7*b*tan(f*x+e)^7/f+1/5/f*tan(f*x+e)^5*a-1/5*b*tan(f*x+e)^5/f-1/3/f*tan(f*x+e)^3*a+1/3*b*tan(f*x+e)^3/f+1/f*a
*tan(f*x+e)-b*tan(f*x+e)/f-1/f*arctan(tan(f*x+e))*a+b/f*arctan(tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.68975, size = 97, normalized size = 1.21 \begin{align*} \frac{15 \, b \tan \left (f x + e\right )^{7} + 21 \,{\left (a - b\right )} \tan \left (f x + e\right )^{5} - 35 \,{\left (a - b\right )} \tan \left (f x + e\right )^{3} - 105 \,{\left (f x + e\right )}{\left (a - b\right )} + 105 \,{\left (a - b\right )} \tan \left (f x + e\right )}{105 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^6*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/105*(15*b*tan(f*x + e)^7 + 21*(a - b)*tan(f*x + e)^5 - 35*(a - b)*tan(f*x + e)^3 - 105*(f*x + e)*(a - b) + 1
05*(a - b)*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.0787, size = 178, normalized size = 2.22 \begin{align*} \frac{15 \, b \tan \left (f x + e\right )^{7} + 21 \,{\left (a - b\right )} \tan \left (f x + e\right )^{5} - 35 \,{\left (a - b\right )} \tan \left (f x + e\right )^{3} - 105 \,{\left (a - b\right )} f x + 105 \,{\left (a - b\right )} \tan \left (f x + e\right )}{105 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^6*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/105*(15*b*tan(f*x + e)^7 + 21*(a - b)*tan(f*x + e)^5 - 35*(a - b)*tan(f*x + e)^3 - 105*(a - b)*f*x + 105*(a
- b)*tan(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 1.18512, size = 109, normalized size = 1.36 \begin{align*} \begin{cases} - a x + \frac{a \tan ^{5}{\left (e + f x \right )}}{5 f} - \frac{a \tan ^{3}{\left (e + f x \right )}}{3 f} + \frac{a \tan{\left (e + f x \right )}}{f} + b x + \frac{b \tan ^{7}{\left (e + f x \right )}}{7 f} - \frac{b \tan ^{5}{\left (e + f x \right )}}{5 f} + \frac{b \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac{b \tan{\left (e + f x \right )}}{f} & \text{for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right ) \tan ^{6}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**6*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((-a*x + a*tan(e + f*x)**5/(5*f) - a*tan(e + f*x)**3/(3*f) + a*tan(e + f*x)/f + b*x + b*tan(e + f*x)*
*7/(7*f) - b*tan(e + f*x)**5/(5*f) + b*tan(e + f*x)**3/(3*f) - b*tan(e + f*x)/f, Ne(f, 0)), (x*(a + b*tan(e)**
2)*tan(e)**6, True))

________________________________________________________________________________________

Giac [B]  time = 6.26445, size = 1467, normalized size = 18.34 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^6*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

-1/105*(105*a*f*x*tan(f*x)^7*tan(e)^7 - 105*b*f*x*tan(f*x)^7*tan(e)^7 - 735*a*f*x*tan(f*x)^6*tan(e)^6 + 735*b*
f*x*tan(f*x)^6*tan(e)^6 + 105*a*tan(f*x)^7*tan(e)^6 - 105*b*tan(f*x)^7*tan(e)^6 + 105*a*tan(f*x)^6*tan(e)^7 -
105*b*tan(f*x)^6*tan(e)^7 + 2205*a*f*x*tan(f*x)^5*tan(e)^5 - 2205*b*f*x*tan(f*x)^5*tan(e)^5 - 35*a*tan(f*x)^7*
tan(e)^4 + 35*b*tan(f*x)^7*tan(e)^4 - 735*a*tan(f*x)^6*tan(e)^5 + 735*b*tan(f*x)^6*tan(e)^5 - 735*a*tan(f*x)^5
*tan(e)^6 + 735*b*tan(f*x)^5*tan(e)^6 - 35*a*tan(f*x)^4*tan(e)^7 + 35*b*tan(f*x)^4*tan(e)^7 - 3675*a*f*x*tan(f
*x)^4*tan(e)^4 + 3675*b*f*x*tan(f*x)^4*tan(e)^4 + 21*a*tan(f*x)^7*tan(e)^2 - 21*b*tan(f*x)^7*tan(e)^2 + 245*a*
tan(f*x)^6*tan(e)^3 - 245*b*tan(f*x)^6*tan(e)^3 + 2205*a*tan(f*x)^5*tan(e)^4 - 2205*b*tan(f*x)^5*tan(e)^4 + 22
05*a*tan(f*x)^4*tan(e)^5 - 2205*b*tan(f*x)^4*tan(e)^5 + 245*a*tan(f*x)^3*tan(e)^6 - 245*b*tan(f*x)^3*tan(e)^6
+ 21*a*tan(f*x)^2*tan(e)^7 - 21*b*tan(f*x)^2*tan(e)^7 + 3675*a*f*x*tan(f*x)^3*tan(e)^3 - 3675*b*f*x*tan(f*x)^3
*tan(e)^3 + 15*b*tan(f*x)^7 - 42*a*tan(f*x)^6*tan(e) + 147*b*tan(f*x)^6*tan(e) - 420*a*tan(f*x)^5*tan(e)^2 + 7
35*b*tan(f*x)^5*tan(e)^2 - 3150*a*tan(f*x)^4*tan(e)^3 + 3675*b*tan(f*x)^4*tan(e)^3 - 3150*a*tan(f*x)^3*tan(e)^
4 + 3675*b*tan(f*x)^3*tan(e)^4 - 420*a*tan(f*x)^2*tan(e)^5 + 735*b*tan(f*x)^2*tan(e)^5 - 42*a*tan(f*x)*tan(e)^
6 + 147*b*tan(f*x)*tan(e)^6 + 15*b*tan(e)^7 - 2205*a*f*x*tan(f*x)^2*tan(e)^2 + 2205*b*f*x*tan(f*x)^2*tan(e)^2
+ 21*a*tan(f*x)^5 - 21*b*tan(f*x)^5 + 245*a*tan(f*x)^4*tan(e) - 245*b*tan(f*x)^4*tan(e) + 2205*a*tan(f*x)^3*ta
n(e)^2 - 2205*b*tan(f*x)^3*tan(e)^2 + 2205*a*tan(f*x)^2*tan(e)^3 - 2205*b*tan(f*x)^2*tan(e)^3 + 245*a*tan(f*x)
*tan(e)^4 - 245*b*tan(f*x)*tan(e)^4 + 21*a*tan(e)^5 - 21*b*tan(e)^5 + 735*a*f*x*tan(f*x)*tan(e) - 735*b*f*x*ta
n(f*x)*tan(e) - 35*a*tan(f*x)^3 + 35*b*tan(f*x)^3 - 735*a*tan(f*x)^2*tan(e) + 735*b*tan(f*x)^2*tan(e) - 735*a*
tan(f*x)*tan(e)^2 + 735*b*tan(f*x)*tan(e)^2 - 35*a*tan(e)^3 + 35*b*tan(e)^3 - 105*a*f*x + 105*b*f*x + 105*a*ta
n(f*x) - 105*b*tan(f*x) + 105*a*tan(e) - 105*b*tan(e))/(f*tan(f*x)^7*tan(e)^7 - 7*f*tan(f*x)^6*tan(e)^6 + 21*f
*tan(f*x)^5*tan(e)^5 - 35*f*tan(f*x)^4*tan(e)^4 + 35*f*tan(f*x)^3*tan(e)^3 - 21*f*tan(f*x)^2*tan(e)^2 + 7*f*ta
n(f*x)*tan(e) - f)